﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eSeller.Models
{
    public partial class Product
    {
        public double VoteScore { get; set; }

        public void CalculateVoteScore()
        {
            var s = this.Votes.Average(v => v.Score);            
            VoteScore = s == null ? 0 : (double)Math.Round((decimal)s, 1);
        }
    }
}
